package com.haoniu.module.service.impl;

import com.haoniu.common.support.Convert;
import com.haoniu.module.domain.database.LuckWheel;
import com.haoniu.module.mapper.LuckWheelMapper;
import com.haoniu.module.service.LuckWheelService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 幸运转盘 服务层实现
 *
 * @author houyijun
 * @date 2019-03-20
 */
@Service
public class LuckWheelServiceImpl implements LuckWheelService {
    @Autowired
    private LuckWheelMapper luckWheelMapper;

    /**
     * 查询幸运转盘信息
     *
     * @param id 幸运转盘ID
     * @return 幸运转盘信息
     */
    @Override
    public LuckWheel selectLuckWheelById(Integer id) {
        return luckWheelMapper.selectLuckWheelById(id);
    }

    /**
     * 查询幸运转盘列表
     *
     * @param luckWheel 幸运转盘信息
     * @return 幸运转盘集合
     */
    @Override
    public List<LuckWheel> selectLuckWheelList(LuckWheel luckWheel) {
        return luckWheelMapper.selectLuckWheelList(luckWheel);
    }

    /**
     * 新增幸运转盘
     *
     * @param luckWheel 幸运转盘信息
     * @return 结果
     */
    @Override
    public int insertLuckWheel(LuckWheel luckWheel) {
        return luckWheelMapper.insertLuckWheel(luckWheel);
    }

    /**
     * 修改幸运转盘
     *
     * @param luckWheel 幸运转盘信息
     * @return 结果
     */
    @Override
    public int updateLuckWheel(LuckWheel luckWheel) {
        return luckWheelMapper.updateLuckWheel(luckWheel);
    }

    /**
     * 删除幸运转盘对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteLuckWheelByIds(String ids) {
        return luckWheelMapper.deleteLuckWheelByIds(Convert.toStrArray(ids));
    }

}
